$(function(){
    $("#btn_query").bind("click",modifypass);
});
function modifypass() {
    var oldpass = $("#search_oldpass").val();
    var newpass = $("#search_newpass").val();

    if (oldpass == "" || oldpass == null) {
        $("#o1").html("<font color=red>请输入原密码！</font>");
        return;
    }
    if (newpass == "" || newpass == null) {
        $("#o2").html("<font color=red>请输入新密码！</font>");
        return;
    }
    $("#btn_query").attr('disabled', "true");
    $.ajax({
        type: 'post',
        url: '/do/user/modifypass',
        data: {
            oldpass: oldpass,
            newpass: newpass,
        },
        dataType: "json",
        success: function (data) {
            $('#btn_query').removeAttr("disabled");
            $("#o1").html("");
            $("#o2").html("");
            if (data.code == 1) {
                Ewin.alert("修改成功！");
            } else {
                Ewin.alert(data.msg)
            }
        }
    });
}
